package com.cavy.platform.server.validator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.FIELD;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * 工作空间名称不能重复
 * 工作空间名称不能为空
 * author: 唐旭
 */
@Target({FIELD})
@Retention(RUNTIME)
@Documented
@Constraint(validatedBy = {WorkSpaceNotRepeatValidator.class})
public @interface WorkSpaceNotRepeat {
    //默认错误消息
    String message() default "工作空间名称错误";

    //分组
    Class<?>[] groups() default {};

    //负载
    Class<? extends Payload>[] payload() default {};
}
